package com.meme.io.packager;

import com.meme.editor.level.define.ActorTemplate;
import com.meme.editor.level.define.AppearanceDefine;
import com.meme.editor.level.define.DefineFile;
import com.meme.editor.level.define.Parameter;
import com.meme.editor.level.define.PropertyDefine;
import com.meme.editor.level.define.PropertyDefineBlock;

import java.io.RandomAccessFile;

import org.apache.log4j.Logger;

import com.meme.util.FileUtil;

import com.meme.editor.EntityObject;

public class DefineBinFileWriter 
{
	static Logger logger = Logger.getLogger(DefineBinFileWriter.class);
	
	public void writeToFile (DefineFile defineFile, String binFilename)
	{	
		try
		{
			FileUtil.deleteFile (binFilename);
			
			RandomAccessFile binFile  = new RandomAccessFile (binFilename, "w");

			
			writeDefineFile (defineFile, binFile);
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
	
	
	void writeDefineFile (DefineFile defineFile, RandomAccessFile binFile) throws Exception
	{
		
		DefineFile.ActorTemplateSet actorTemplateSet = defineFile.getActorTemplateSet();
		for (EntityObject entity : actorTemplateSet.getChildren())
		{
			ActorTemplate actorTemplate = (ActorTemplate) entity;
		}
	}
}
